package com.example.demo.controller;


import com.example.demo.service.DeviceService;
import com.example.demo.vo.ResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author sjy
 * @since 2025-05-25
 */
@RestController
@RequestMapping("/device")
@Api(tags = "设备管理")
public class DeviceController {
    @Autowired
    private DeviceService deviceService;

    @GetMapping("/getAllDeviceNames")
    @ApiOperation("获取所有设备名称")
    public ResultVO<List<String>> getAllDeviceNames() {
        List<String> deviceNames = deviceService.getAllDeviceNames();
        return ResultVO.success("获取成功", deviceNames);
    }
}
